package com.yitiao.controller.rpc;

import cn.hutool.json.JSON;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.yitiao.annotation.IgnoreResponseAdvice;
import com.yitiao.feign.UserFeignClient;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/user")
public class UserRpcController {

    private final UserFeignClient userService;

    @GetMapping("/findById")
    @IgnoreResponseAdvice
    public String getUserById(String id) {
        String userById = userService.getUserById(id);
        return userById;
    }
}
